From ba505e496d5eae13c902996d34426c656b9a5330 Mon Sep 17 00:00:00 2001 From: "sos22@labyrinth.cl.cam.ac.uk" Date: Wed, 9 Jul 2003 08:28:43 +0000 Subject: [PATCH] bitkeeper revision 1.303.2.1 (3f0bd23bjmByDrErI4CVnaylQxBxhA) Whitespace cleanup. --- BitKeeper/etc/ignore | 3 ++ tools/internal/xi_phys_grant.c | 73 +++++++++++++++++---------------- tools/internal/xi_phys_probe.c | 66 +++++++++++++++-------------- tools/internal/xi_phys_revoke.c | 43 +++++++++---------- 4 files changed, 94 insertions(+), 91 deletions(-) diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index e8cfff001c..cf41f0cc4e 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -433,3 +433,6 @@ xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c.bak xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~ xen/drivers/block/xen_block.c~ xen/drivers/block/xen_physdisk.c~ +tools/internal/xi_phys_grant.c~ +tools/internal/xi_phys_probe.c~ +tools/internal/xi_phys_revoke.c~ diff --git a/tools/internal/xi_phys_grant.c b/tools/internal/xi_phys_grant.c index 58c00ed882..368414f4f5 100644 --- a/tools/internal/xi_phys_grant.c +++ b/tools/internal/xi_phys_grant.c @@ -10,40 +10,41 @@ int main(int argc, char *argv[]) { - xp_disk_t buf; - int fd; - char *strbuf; - - if (argc != 7) { - fprintf(stderr, "Usage: xi_physdev_grant \n"); - return 1; - } - - buf.mode = 0; - if (argv[1][0] == 'r') - buf.mode |= 1; - else if (argv[1][0] == 'w') - buf.mode |= 2; - if (argv[1][1] == 'r') - buf.mode |= 1; - else if (argv[1][1] == 'w') - buf.mode |= 2; - - buf.device = atol(argv[3]); - buf.start_sect = atol(argv[4]); - buf.n_sectors = atol(argv[5]); - buf.partition = atol(argv[6]); - - asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]); - fd = open(strbuf, O_WRONLY); - if (fd < 0) { - fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); - return 1; - } - free(strbuf); - - write(fd, &buf, sizeof(buf)); - close(fd); - - return 0; + xp_disk_t buf; + int fd; + char *strbuf; + + if (argc != 7) { + fprintf(stderr, + "Usage: xi_physdev_grant \n"); + return 1; + } + + buf.mode = 0; + if (argv[1][0] == 'r') + buf.mode |= 1; + else if (argv[1][0] == 'w') + buf.mode |= 2; + if (argv[1][1] == 'r') + buf.mode |= 1; + else if (argv[1][1] == 'w') + buf.mode |= 2; + + buf.device = atol(argv[3]); + buf.start_sect = atol(argv[4]); + buf.n_sectors = atol(argv[5]); + buf.partition = atol(argv[6]); + + asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[2]); + fd = open(strbuf, O_WRONLY); + if (fd < 0) { + fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); + return 1; + } + free(strbuf); + + write(fd, &buf, sizeof(buf)); + close(fd); + + return 0; } diff --git a/tools/internal/xi_phys_probe.c b/tools/internal/xi_phys_probe.c index e38bb1634b..a3dfd8952b 100644 --- a/tools/internal/xi_phys_probe.c +++ b/tools/internal/xi_phys_probe.c @@ -10,43 +10,41 @@ int main(int argc, char *argv[]) { - physdisk_probebuf_t buf; - int fd; - int x; - char *strbuf; + physdisk_probebuf_t buf; + int fd; + int x; + char *strbuf; - if (argc != 2) { - fprintf(stderr, "Usage: xi_phys_probe \n"); - return 1; - } + if (argc != 2) { + fprintf(stderr, "Usage: xi_phys_probe \n"); + return 1; + } - asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]); - fd = open(strbuf, O_RDONLY); - if (fd < 0) { - fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); - return 1; - } - free(strbuf); + asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]); + fd = open(strbuf, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); + return 1; + } + free(strbuf); - memset(&buf, 0, sizeof(buf)); - buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST; - do { + memset(&buf, 0, sizeof(buf)); buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST; - read(fd, &buf, sizeof(buf)); - if (!buf.n_aces) - break; + do { + buf.n_aces = PHYSDISK_MAX_ACES_PER_REQUEST; + read(fd, &buf, sizeof(buf)); + if (!buf.n_aces) + break; - for (x = 0; x < buf.n_aces; x++) { - char read = ( buf.entries[x].mode & 1 ? 'r' : ' ' ); - char write = ( buf.entries[x].mode & 2 ? 'w' : ' ' ); - printf("%x %x %lx %lx %c%c\n", buf.entries[x].device, - buf.entries[x].partition, - buf.entries[x].start_sect, - buf.entries[x].n_sectors, - read, - write); - } - buf.start_ind += buf.n_aces; - } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST); - return 0; + for (x = 0; x < buf.n_aces; x++) { + char read = (buf.entries[x].mode & 1 ? 'r' : ' '); + char write = (buf.entries[x].mode & 2 ? 'w' : ' '); + printf("%x %x %lx %lx %c%c\n", buf.entries[x].device, + buf.entries[x].partition, + buf.entries[x].start_sect, + buf.entries[x].n_sectors, read, write); + } + buf.start_ind += buf.n_aces; + } while (buf.n_aces == PHYSDISK_MAX_ACES_PER_REQUEST); + return 0; } diff --git a/tools/internal/xi_phys_revoke.c b/tools/internal/xi_phys_revoke.c index 2bcfacb591..c39146e889 100644 --- a/tools/internal/xi_phys_revoke.c +++ b/tools/internal/xi_phys_revoke.c @@ -10,30 +10,31 @@ int main(int argc, char *argv[]) { - xp_disk_t buf; - int fd; - char *strbuf; + xp_disk_t buf; + int fd; + char *strbuf; - if (argc != 5) { - fprintf(stderr, "Usage: xi_physdev_revoke \n"); - return 1; - } + if (argc != 5) { + fprintf(stderr, + "Usage: xi_physdev_revoke \n"); + return 1; + } - buf.device = atol(argv[2]); - buf.mode = 0; - buf.start_sect = atol(argv[3]); - buf.n_sectors = atol(argv[4]); + buf.device = atol(argv[2]); + buf.mode = 0; + buf.start_sect = atol(argv[3]); + buf.n_sectors = atol(argv[4]); - asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]); - fd = open(strbuf, O_WRONLY); - if (fd < 0) { - fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); - return 1; - } - free(strbuf); + asprintf(&strbuf, "/proc/xeno/dom%s/phd", argv[1]); + fd = open(strbuf, O_WRONLY); + if (fd < 0) { + fprintf(stderr, "Can\'t open %s: %s.\n", strbuf, strerror(errno)); + return 1; + } + free(strbuf); - write(fd, &buf, sizeof(buf)); - close(fd); + write(fd, &buf, sizeof(buf)); + close(fd); - return 0; + return 0; } -- 2.30.2